1. Field of the Invention
The present invention relates to a microcontroller, and specifically relates to a timer unit circuit included in a microcontroller.
2. Description of Related Art
Microcontrollers have been employed in various types of products. These microcontrollers have provided various types of control by executing control based on a program stored in a ROM (Read Only Memory), while they have been designed to have a common configuration to the greatest possible extent to reduce the costs.
However, for a timer unit circuit included in a microcontroller, a dedicated product has been designed in response to demanded control, for example, control of an inverter for a motor. Accordingly, it has been difficult to reduce the development costs of the microcontrollers.
FIG. 1 shows a microcontroller for motor control, which is disclosed in Japanese Patent Application Laid-open No. 5-115193 (Patent Document1). The microcontroller includes a timer B, one-shot pulse timers A0 to A2, timers C0 to C2, toggle flip-flops TFF0 to TFF2, D-flip-flops DFF01 to DFF22, NAND circuits NAND01 to NAND22, output stop registers STR0 to STR2, OR circuits OR, OR01 to OR22, output polarity setting buffers BF0 to BF2, AND circuits AND01 to AND22, and a flip-flop FF. An interrupt signal INTO and a reset signal RE are input to the OR circuit OR.
The microcontroller outputs a U-phase, a U-bar phase signal, a V-phase signal, a V-bar phase signal, a W-phase signal and a W-bar phase signal to control a three-phase motor. The timer B generates a signal corresponding to a PWM (Pulse Width Modulation) carrier frequency. The one-shot pulse timers A0 to A2 determine the pulse widths of the three phases. The timers C0 to C2 determine upper and lower-arm short circuit prevention times (dead times) for the three phases. In this microcontroller, the roles of the respective timers are fixed.
As a result of setting the output stop registers STR0 to STR2, the microcontroller can execute control of a two-phase operation mode.
Japanese Patent Application Laid-Open No. 10-323084 (Patent Document 2) discloses a motor control device used for control of a three-phase inverter motor.